<template>
  <div style="padding-top: 50px">
    <myHeader></myHeader>
   <div class="detailBox">
     <div class="newsTitle">{{ newsChange.title }}</div>
     <peopleShow  :imgList="newsChange"  v-if="content&&articleFlag"></peopleShow>
     <newsShowContent :content="content"  v-if="content&&articleFlag"></newsShowContent>
     <div class="newsSource">
       <img :src=newsChange.bannerImgUrl alt="">
       <div>
         <p>{{ newsChange.articleSource }}</p>
         <p>{{newsChange.title}}</p>
       </div>
       <van-button @click="alert1" type="info" class="concernBtn">关注</van-button>
     </div>
     <div class="newsTitle">
<!--       <div v-for="num in 3" :key="num">大气科学</div>-->
     </div>
     <myEssayFooter :imgList="newsChange"  v-if="content&&articleFlag"></myEssayFooter>
<!--     <comments></comments>-->

   </div>
<!--    <myFooter></myFooter>-->
  </div>
</template>

<script>


import {articleDetails} from "@/http/api";
import myHeader from "@/components/myHeader";
import peopleShow from "@/components/peopleShow";
import newsShowContent from "@/components/newsShowContent";
import myEssayFooter from "@/components/myEssayFooter";
import {Toast} from "vant";


export default {
  name: "Detail",
  components:{
    myHeader,
    peopleShow,
    newsShowContent,
    myEssayFooter,
  },
  methods:{
    alert1()
    {
      Toast('该功能正在开发');
    }
  },
  data(){
    return{
      content:'123123',
      articleFlag: false,
      showDialog: false,
      newsChange:{}
    }
  },
  created: function () {
    articleDetails(this.$route.query.articleId).then(res => {
      this.content = res.data.data.content
      this.newsChange = res.data.data
      this.articleFlag = true
      this.showDialog = true
    })

  },
}
</script>

<style scoped lang="less">
.detailBox{
  margin: 0 15px 0 16px;
  .newsTitle{
    margin-top: 10px!important;
    line-height: 35px;
    font-size: 24px;
    text-align: left;
    font-family: PingFangSC-regular;
  }
  .newsSource{
    padding: 12px 8px;
    display: flex;
    justify-content: space-between;
    border: 1px solid rgba(255, 0, 0, 0);
    >img{
      width: 52px;
      height: 52px;
      border-radius: 50%;
      background-color: rgba(255, 152, 0, 1);
      margin-right: 9px;
    }
    >div{
      overflow: hidden;
      height: 58px;
      margin-top: 4px;
      flex-grow: 1;
      >p:first-child{
        font-size: 16px;
        margin: 0;
        font-weight: 700;
      }
      >p:last-child{
        width: 85%;
        font-size: 12px;
        margin: 0;
      }

    }
    >.concernBtn{
      width: 58px;
      height: 30px;
      border-radius: 4px;
      font-size: 14px;
      text-align: center;
      font-family: Arial;
      margin-top: 11px;
    }
    .van-button__content{
      width: 30px;
    }
  }
  .newsTitle{
    display: flex;
    margin-top: 51px;
    >div{
      height: 30px;
      margin-right: 3px;
      background-color: rgba(244, 245, 247, 1);
      font-size: 14px;
      text-align: center;
      padding: 0 10px;
    }
  }
}

</style>